<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>正则表达式</title>
</head>

<body>
	
</body>
<script>
	
	str='linux and and 2 and 3 and 20 and linox and linax lin x php and LINUX and Php and pap and p\np nd p_p and linxx is lamp';
	//document.write(str); //浏览器验证\n换行
	arr=str.match(/p.p/ig); 
	//.代表任意一个字符，除了换行符，范围更广。匹配不到p\np

	alert(arr);
</script>
</html>